import { Spin } from 'antd';
import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import App from './app';
import './index.css';
import { persistor, store } from './store';

const rootElment = document.getElementById('root');
const root = createRoot(rootElment!);

root.render(
    <PersistGate
        loading={
            <Spin
                size="large"
                style={{
                    display: 'flex',
                    alignItems: 'center',
                    justifyContent: 'center',
                    height: '100%',
                }}
            />
        }
        persistor={persistor}
    >
        <Provider store={store}>
            <App />
        </Provider>
    </PersistGate>
);
